<?php

namespace app\model\product\product;

use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;

class StoreProductTemplate extends BaseModel
{
    use  ModelTrait;

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    protected $table = 'zg_store_product_template';

    // 定义 JSON 类型的字段
    protected $json = ['merchant_params'];


//    public function get

    public function getMerchantParamsAttr($value, $data)
    {
        return !empty($value) ? (array)($value) : [];
    }
}